package com.google.code.avajhelpdesk.persistence;

import java.io.Serializable;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

public interface IGenericDAO {

	<T> T get(Class<T> type, Serializable id);

    <T> List<T> findAll(Class<T> type);

	<T> List<T> findAll(Class<T> type, int firstToRetrive, int maxToRetrive);

	<T> T persist(T entity);

	<T> T merge(T entity);
	
	void remove(Object entity);

	<T> int count(Class<T> type);
	
	List findByCriteria(DetachedCriteria criteria, int firstToRetrive, int maxToRetrive);

	List findByCriteria(DetachedCriteria criteria);
	
	List<Class> getAllTypes();

	void reattach(Object entity);

}